From: rwing!pat@ole.cdac.com (Pat Myrto) And if a temp file MUST be made, use the mkstemp() call to generate the name and open it. Mkstemp() atomically generates the tempname from the template, opens the file and returns a handle. As the manpage says, mkstemp() eliminates the race condition between testing if a file exists, and the opening of the tmp file. But 'mkstemp()' is in section 3 of the manual; it's a subroutine, not a system call, so how can it be 'atomic'?